package com.guan.cmsservice.controller;


import com.guan.cmsservice.entity.CrmBanner;
import com.guan.cmsservice.service.CrmBannerService;
import com.guan.commonutils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2023-03-13
 *
 * 前台用户使用
 */
@RestController
@RequestMapping("/cmsservice/bannerFront")
@CrossOrigin
public class BannerFrontController {


    @Autowired
    private CrmBannerService bannerService;

    /**
     * @date: 2023/3/13 12:31
     * @author: 管奇安
     * @description: 查询所有banner
     * @param: []
     * @return: com.guan.commonutils.R
     **/
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> bannerList = bannerService.selectAllBanner();
        return R.ok().data("items",bannerList);
    }




}

